#include<bits/stdc++.h>
using namespace std;
int main(){
	int n, x;
	int cnt1 = 0, cnt2 = 0;
	cin>>n;
	while(n--){
		cin>>x;
		if(x >= 60){
			cnt1++;
		}
		if(x >= 85){
			cnt2++;
		}
	}
	cout<<cnt1<<"\n"<<cnt2;
	return 0;
}
